package edu.itcs6112.za.domain;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;
import javax.validation.constraints.Size;

@Entity
@Table(name = "item")
public class Item implements Serializable {
	
	private static final long serialVersionUID = 1L;
	private Long P_Id;
	private int version;
	private String name;
	private String description;
	private String image_url;
	private double price;
	private String itemType;
	
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "P_Id")
	public Long getId() {
		return P_Id;
	}
	
	public void setId(Long aId) {
		this.P_Id = aId;
	}
	
	@Version
	@Column(name = "ITEM_VERSION")
	public int getVersion() {
		return version;
	}
	
	public void setVersion(int version) {
		this.version = version;
	}
	
	@Size(min=3, max=60, message="Too big")
	@Column(name = "NAME")
	public String getName() {
		return name;
	}
	
	public void setName(String aName) {
		this.name = aName;
	}
	
	@Column(name = "DESCRIPTION")
	public String getDescription() {
		return description;
	}
	
	public void setDescription(String aDescription) {
		this.description = aDescription;
	}
	
	@Column(name = "IMAGE_PATH")
	public String getImage() {
		return image_url;
	}

	public void setImage(String aImage_url) {
		this.image_url = aImage_url;
	}	
	
	@Column(name = "PRICE")
	public double getPrice() {
		return price;
	}
	
	public void setPrice(double aPrice) {
		this.price = aPrice;
	}
	
	@Column(name = "ITEM_TYPE")
	public String getItemType() {
		return itemType;
	}
	
	public void setItemType(String aItemType) {
		this.itemType = aItemType;
	}

}
